import React from "react";
import {Routes ,Route ,Link} from "react-router-dom";

export default class Home extends React.Component {
    constructor(prop) {
        super(prop);
        console.log(this.props); 
    }

    render() {
        return (
            <div>
                
            <Link to='news1'>首页</Link>
            <Link to='news2'>首页</Link>
            <Link to='news3'>首页</Link>

            <Routes>
            {
                this.props.children.map((item, index) => {
                    return   <Route key={item.path} path={item.path} element={item.element}></Route>
                })
            }
              
            </Routes>

    

            </div>
        )
    }
}